# uncompyle6 version 3.2.3
# Python bytecode 3.6 (3379)
# Decompiled from: Python 3.6.8 |Anaconda custom (64-bit)| (default, Feb 21 2019, 18:30:04) [MSC v.1916 64 bit (AMD64)]
# Embedded file name: helpers\setup_types.py
__author__ = "Attila Gerendi (Sanyi)"
from settings_provider import settings as __settings

AWS = "aws"
ON_PREMISE_MASTER = "on_premise"
ON_PREMISE_WORKER = "on_premise_worker"


def get_setup_type():
    return __settings.get("setup_type")


def is_setup_type_aws():
    return __settings.get("setup_type") == AWS


def is_setup_type_on_premise_worker():
    return __settings.get("setup_type") == ON_PREMISE_WORKER


def is_setup_type_on_premise_master():
    return __settings.get("setup_type") == ON_PREMISE_MASTER


def is_setup_type_on_premise():
    return is_setup_type_on_premise_worker() or is_setup_type_on_premise_master()


def is_setup_type(setup_type):
    return setup_type == __settings.get("setup_type")


class SetupFeatures:
    PER_ACCOUNT_EXCLUDED_HOURS = "per_account_excluded_hours"
    CAN_GLOBALLY_SUSPEND_SCAN_STARTING = "can_globally_suspend_scan_staring"
    TARGET_CHECKING_MANDATORY = "target_checking_mandatory"
    SALES_UPDATES = "sales_updates"
    MANUAL_BROWSING = "manual_browsing"
    STORE_SCAN_DEPENDENCY_ON_LOCAL_FS = "store_scan_dependency_locally"
    STORE_SCAN_DEPENDENCY_ON_S3 = "store_scan_dependency_on_S3"
    DIRECT_LICENSE_HANDLING = "direct_license_handling"
    EMAIL_FILTERING = "email_filtering"


def has_feature(feature):
    if __settings.get("setup_type") == AWS:
        return feature in (
            SetupFeatures.PER_ACCOUNT_EXCLUDED_HOURS,
            SetupFeatures.TARGET_CHECKING_MANDATORY,
            SetupFeatures.SALES_UPDATES,
            SetupFeatures.STORE_SCAN_DEPENDENCY_ON_S3,
            SetupFeatures.DIRECT_LICENSE_HANDLING,
            SetupFeatures.EMAIL_FILTERING,
        )
    elif __settings.get("setup_type") == ON_PREMISE_MASTER:
        return feature in (
            SetupFeatures.CAN_GLOBALLY_SUSPEND_SCAN_STARTING,
            SetupFeatures.MANUAL_BROWSING,
            SetupFeatures.STORE_SCAN_DEPENDENCY_ON_LOCAL_FS,
        )
    else:
        return False


class Implementations:
    pass


def is_implementation(implementation):
    if __settings.get("setup_type") == AWS:
        return implementation in ()
    else:
        return False
